package com.lagou.service.impl;

import com.lagou.dao.ArticleDao;
import com.lagou.domain.Article;
import com.lagou.service.ArticleService;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleServiceImpl implements ArticleService {

    @Autowired
    private ArticleDao articleDao;

    @Override
    public List<Article> findAll() {

        return articleDao.findAll();
    }

    @Override
    public void saveArticle(Article article) {
        articleDao.saveArticle(article);
        int i = 1/0;
        articleDao.saveArticle(article);
        System.out.println("添加文章成功！");
    }
}
